/***********************************************
* Filename:  		WinM_InputHandler.h
* Date:      		01/12/2014
* Mod. Date: 		01/12/2014
* Author:    		Night
* Purpose:   		Handles keyboard input based
					on Windows Messages.
					Uses VIK key codes for input.
					VIK Reference: http://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx
************************************************/

#ifndef WINM_INPUT_HANDLER_H_
#define WINM_INPUT_HANDLER_H_

#include <Windows.h>

#define KEY_DOWN( _cKey ) CWinM_InputHandler::GetInstance()->CheckKeyDown( _cKey )
#define KEY_PRESSED( _cKey ) CWinM_InputHandler::GetInstance()->CheckKeyPressed( _cKey )
#define KEY_UP( _cKey ) CWinM_InputHandler::GetInstance()->CheckKeyUp( _cKey )

class CWinM_InputHandler
{
public:
	static CWinM_InputHandler *GetInstance( void );

	void Init( void );
	void Release( void );

	void Update( void );

	bool CheckKeyDown( const unsigned char _cKey );
	bool CheckKeyUp( const unsigned char _cKey );
	bool CheckKeyPressed( const unsigned char _cKey );

	// Place inside your win proc WM_KEYDOWN
	//	-Param: wParam
	void Acion_PressKey( const unsigned char _cKey );

	// Place inside your win proc WM_KEYUP
	//	-Param: wParam
	void Acion_UnPressKey( const unsigned char _cKey );
private:
	CWinM_InputHandler( void );
	~CWinM_InputHandler( void );

	unsigned char	m_cInputBuffer[256];
	unsigned char	m_cPrevInputBuffer[256];
};

#endif